import React,{Component} from "react"  


class Radio extends Component{
     constructor(){
          super();
          this.state={
              radioVal:'男'
          }
     }
	 
     render(){
          let {radioVal}=this.state
          return (
              <div>
                   <p>
                      男:<input type="radio" value="男"  onChange={this.handelRadio.bind(this)}   checked={radioVal==="男"}/>
                   </p>
                   <p>
                      女:<input type="radio" value="女"  onChange={this.handelRadio.bind(this)}   checked={radioVal==="女"}/>
                   </p>
                   <p>您选择的性别是----{radioVal}</p>
              </div>
          )
     }
     handelRadio(e){
          let val = e.target.value
          this.setState({
              radioVal:val
          })
     }
}
export default Radio